﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FDEE.Model
{
    public class BufferReber : BufferBase
    {
        public List<Tuple<string, RebarCollection>> bufferRebarTuples = new List<Tuple<string, RebarCollection>>();
        public BufferReber(string typeName, string pierNumber,
            int height, int width) : base(typeName, pierNumber, height, width)
        {

        }

       public override void SetRebarList()
        {
            int N3 = 4;
            #region 全局变量
            for (int i = 3; i < 30; i++)
            {
                RebarList = new RebarCollection();
                int aa = 0, bb = 0, cc = 0;
                aa = (int)(600 + (i+1) * 100 - 50 - 12);
                cc = aa;
                bb = 500 - 50 * 2 - 12 * 2;
                RebarList.Add(new MCRebarRecord(1, 0, "", eDB.DB20, aa, bb, cc, 2, eShapeType.MCB));
                aa = (int)(400 + (i + 1) * 100 - 50);
                cc = aa;
                bb = 250 - 50 * 2;
                //N2 = i * 100 / 150;
                RebarList.Add(new MCRebarRecord(2, 0, "", eDB.DB12, aa, bb, cc, 4, eShapeType.MCB));
                aa = 250 - 50 * 2 - 12 * 4;
                bb = 500 - 50 * 2 - 12 * 2;
                N3 = (i + 1) * 100 / 150;
                N3 =(int) Math.Round((i + 1) * 100 / 150.0, MidpointRounding.AwayFromZero);
                RebarList.Add(new MORebarRecord(3, 0, "", eDB.DB12, N3, eShapeType.MO, aa, bb));
               
                Tuple<string, RebarCollection> tuple = new Tuple<string, RebarCollection>(i * 0.1+"<H<="+ (i+1) * 0.1, RebarList);
                bufferRebarTuples.Add(tuple);
            }
            #endregion
        }
    }
}
